<template>
  <div class="createPost-container">
    <el-container style="height: 100%;">
      <el-main style="padding:0;height: calc(100% - 42px);">
        <el-container style="height: 100%;">
          <el-main class="main-full-height">
            <div class="editor-container" style="height: 100%;">
              <FormContainer ref="contentDataForm" :edit-info="editInfo" :scheme-type="schemeType" />
            </div>
          </el-main>
        </el-container>
      </el-main>
    </el-container>
  </div>
</template>

<script>
import FormContainer from '@/components/flowset/Formcreated/index'
import { mapGetters, mapActions } from 'vuex'

export default {
  name: 'FormDetail',
  components: {
    FormContainer
  },
  props: {
    isEdit: {
      type: Boolean,
      default: false
    },
    formData: {
      type: Array,
      default: () => []
    },
    schemeType: {
      type: Number,
      default: 0
    }
  },
  data() {
    return {
      // postForm: Object.assign({}, defaultForm),

    }
  },
  computed: {
    ...mapGetters(['defaultorgid', 'formDetails', 'addFormDetail']),
    editInfo() {
      return this.formData
    }
  },
  mounted() {
    this.init()
  },

  methods: {
    ...mapActions(['saveFormDetails', 'saveAddFormDetails', 'updateIsRender']),
    init() {

    },
    updateForm() {
      this.$emit('update:formData', this.$refs.contentDataForm.getJSON())
    }
  }
}

</script>

<style rel="stylesheet/scss" lang="scss" scoped>
  @import "src/styles/mixin.scss";
.main-full-height{
    height: calc(100vh - 330px);
    padding: 10px;
}
  .createPost-container {
    position: relative;
    height: 100%;
    overflow:hidden;
    margin: 0;

    .createPost-main-container {
      margin: 10px;
      background-color: white;
      padding: 10px;
      padding-top: 0;

      .postInfo-container {
        position: relative;
        @include clearfix;
        margin-bottom: 10px;

        .postInfo-container-item {
          float: left;
        }
      }

      .editor-container {
        min-height: 500px;
        margin: 0 0 30px;

        .editor-upload-btn-container {
          text-align: right;
          margin-right: 10px;

          .editor-upload-btn {
            display: inline-block;
          }
        }
      }
    }

    .word-counter {
      width: 40px;
      position: absolute;
      right: -10px;
      top: 0px;
    }
  }

</style>
